<template>

  <van-nav-bar
      title="标题"
      left-arrow
      @click-left="onClickBack"
      @click-right="onClickSearch"
  >
    <template #right>
      <van-icon name="search" size="18" />
    </template>
  </van-nav-bar>

  <router-view/>

  <van-tabbar route @change="onChange">
    <van-tabbar-item to="/" icon="home-o" name="index">主页</van-tabbar-item>
    <van-tabbar-item to="/team" icon="friends-o" name="team">队伍</van-tabbar-item>
    <van-tabbar-item to="/user" icon="contact-o" name="user">个人</van-tabbar-item>
  </van-tabbar>

</template>

<script setup lang="ts">
import { useRouter } from 'vue-router';

const router = useRouter();

const onClickBack = () => {
  router.back();
};
const onClickSearch = () => {
  router.push('/search');
};

const onChange = (name:string) => {
  console.log(name);
}

</script>

<style scoped>

</style>